package com.xoa.controller.party;

import com.xoa.model.party.TrashDetection;
import com.xoa.service.party.TrashDetectionService;
import com.xoa.util.ToJson;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.multipart.MultipartFile;

import java.beans.Transient;

@Controller
@RequestMapping("/TrashDetectionController")
public class TrashDetectionController {
    @Autowired
    private TrashDetectionService trashDetectionService;
    /**
     * 查询
     * @param page
     * @param pageSize
     * @param
     * @return
     */
    @RequestMapping("/trdeSelect")
    @ResponseBody
    public ToJson trdeSelect(Integer page, Integer pageSize, Integer tinid, boolean useFlag){
        return  trashDetectionService.trdeSelect(page,pageSize,tinid,useFlag);
    }

    @RequestMapping("/trdeSelectList")
    @ResponseBody
    public ToJson trdeSelectList(Integer page, Integer pageSize, TrashDetection trashDetection, boolean useFlag){
        return  trashDetectionService.trdeSelectList(page,pageSize,trashDetection,useFlag);
    }

    @RequestMapping("/trdeBySelect")
    @ResponseBody
    public ToJson trdeBySelect(){
        return  trashDetectionService.trdeBySelect();
    }


    /**
     * 删除
     * @param
     * @return
     */
    @RequestMapping("/deletetrde")
    @ResponseBody
    public ToJson delete(Integer tinid){
        return  trashDetectionService.delete(tinid);
    }

    /**
     * 修改
     * @param trashDetection
     * @return
     */
    @RequestMapping("/updatetrde")
    @ResponseBody
    public ToJson update(TrashDetection trashDetection){
        return trashDetectionService.update(trashDetection);
    }

    /**
     * 添加
     */
    @RequestMapping("/addtrde")
    @ResponseBody
    public ToJson add(TrashDetection trashDetection){
        return trashDetectionService.add(trashDetection);
    }


    @RequestMapping("/ecoudInsert")
    @ResponseBody
    @Transient
    public ToJson ecoudInsert(MultipartFile file){
        return trashDetectionService.ecoudInsert(file);
    }
}
